<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>测试</title>
    <style>
      .outer {
        width: 200px;
        height: 100px;
        margin: 50px auto;
        background-color: pink;
        /* word-spacing: -5px; */
      }
      .box1 {
        display: inline-block;
        width: 50%;
        height: 100px;
        background-color: yellow;
      }
      .box2 {
        display: inline-block;
        width: 50%;
        height: 100px;
        background-color: red;
      }
    </style>
  </head>
  <body>
    <!-- 两个行内块元素宽度设置为50% 第二个元素自动换行 -->
    <div class="outer">
      <div class="box1">1</div>
      <div class="box2">2</div>
    </div>
  </body>
</html>
